﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
localhost.WebService ws = new localhost.WebService();
protected void Page_Load(object sender, EventArgs e)
{
    this.AddOnPreRenderCompleteAsync(
        this.BeginCallWebService, 
        this.EndCallWebService
        );
}

private IAsyncResult BeginCallWebService(object sender, EventArgs e, AsyncCallback cb, object extraData)
{
    return ws.BeginHelloWorld(cb, extraData);
}


private void EndCallWebService(IAsyncResult ar)
{
    string time = ws.EndHelloWorld(ar);
    this.Label1.Text = time;
}
    

}